package com.siyuanren.gcocp.common.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.siyuanren.gcocp.common.util.CommonUtils;
import com.siyuanren.gcocp.consts.GcocpConsts;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by   guwr
 * Project_name siyuanren
 * Path         com.siyuanren.common.entity.BaseEntity
 * Date         2017/3/8
 * Time         18:48
 * Description
 */
@Getter
@Setter
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 2572460597926123737L;
    /**
     * 创建时间
     */
    private Date createTime = new Date();
    private Integer id;
    private Integer version = GcocpConsts.ZERO;

    @JsonIgnore
    public Date getCreateTime() {
        return createTime;
    }

    @JsonIgnore
    public Integer getVersion() {
        return version;
    }

    @Override
    public String toString() {
        return CommonUtils.obj2Json(this);
    }
}
